package main
import(
	"fmt"
)


/*
课堂练习：演示一个key-value 的value是map的案例
比如：我们要存放3个学生信息，每个学生有name和sex信息
思路 map[string]map[string]string
*/
func main(){
	studentMap := make(map[string]map[string]string)
	studentMap["stu01"] = make(map[string]string,3)
	studentMap["stu01"]["name"] = "tom"
	studentMap["stu01"]["sex"] = "男"
	studentMap["stu01"]["address"] = "长安街"

	studentMap["stu02"] = make(map[string]string,3)
	studentMap["stu02"]["name"] = "jack"
	studentMap["stu02"]["sex"] = "女"
	studentMap["stu02"]["address"] = "长兴街"

	studentMap["stu03"] = make(map[string]string)
	studentMap["stu03"]["name"] = "jerry"
	studentMap["stu03"]["sex"] = "男"

	fmt.Println("studentMap=",studentMap)
	fmt.Println()


	for k, v := range studentMap{
		fmt.Println("k=",k)
		for k1,v1:=range v{
			fmt.Printf("\t k1=%v,v1=%v\n",k1,v1)
		}
		fmt.Println()
	}


}